package com.openbravo.pos.model;


import java.util.ArrayList;
import java.util.List;

import com.openbravo.data.basic.BasicException;
import com.openbravo.pos.base.AppConfig;

import cn.ekuma.epos.datalogic.I_DataLogicSales;
import cn.ekuma.epos.datalogic.businesslogic.OrderProcessManager;
import cn.ekuma.epos.module.AbstractPosModel;
import cn.ekuma.rabbit.ModelManager;

public abstract class AbstractPosSwingModel extends AbstractPosModel {

	protected boolean isRemoteModel=false;
	
	@Override
	public void init(ModelManager manager) throws BasicException {
		super.init(manager);
		String linkModel=configModel.getProperty(AppConfig.LINK_MODE);
        if(linkModel==null)
        	linkModel="false";
        if("true".equalsIgnoreCase(linkModel)){
           isRemoteModel=true;
           HessianDataLogicModel model=(HessianDataLogicModel) manager.getModelByName(HessianDataLogicModel.NAME);
            model.setup(configModel.getProperty(AppConfig.ERP_URL));
            dlSystem = model.getDLSystem();
            dlERP=model.getDLERP();
            dlSales=(I_DataLogicSales) dlERP;
            dlAdmin=model.getDLAdmin();
            dlCustomers=model.getDLCustomer();		
            dlReceipts=model.getDLReceipts();
            dlSecurity=model.getDLSecurity();
            processManager= new OrderProcessManager();
          }
	}

	@Override
	public List<String> getModelDependents() {
		//List<String> ret=super.getModelDependents();
		//ret.add(HessianDataLogicModel.NAME);
		//ret.add(DefaultDataLogicModel.NAME);
		return null;
	}




	
}
